import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmItemReturnVO, AdmItemReturnForm, AdmItemReturnQuery } from '@/api/general/administration/item/return/types';

/**
 * 查询物品退还列表
 * @param query
 * @returns {*}
 */

export const listAdmItemReturn = (query?: AdmItemReturnQuery): AxiosPromise<AdmItemReturnVO[]> => {
  return request({
    url: '/system/admItemReturn/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询物品退还详细
 * @param id
 */
export const getAdmItemReturn = (id: string | number): AxiosPromise<AdmItemReturnVO> => {
  return request({
    url: '/system/admItemReturn/' + id,
    method: 'get'
  });
};

/**
 * 新增物品退还
 * @param data
 */
export const addAdmItemReturn = (data: AdmItemReturnForm) => {
  return request({
    url: '/system/admItemReturn',
    method: 'post',
    data: data
  });
};

/**
 * 修改物品退还
 * @param data
 */
export const updateAdmItemReturn = (data: AdmItemReturnForm) => {
  return request({
    url: '/system/admItemReturn',
    method: 'put',
    data: data
  });
};

/**
 * 删除物品退还
 * @param id
 */
export const delAdmItemReturn = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/admItemReturn/' + id,
    method: 'delete'
  });
};
